﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using NanoERP.Infrastructure;

namespace NanoERP
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //检测重复运行
            //DoSomething......

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //登录验证
            using (var login = new FrmLogin())
            {
                //登录窗体登录成功返回DialogResult.OK
                //登录用户信息存在于LogonSession全局实例中
                Application.Run(login);
                if (login.DialogResult != DialogResult.OK)
                    return;
            }
            var workSpace = new MainForm();
            Workbench.Init(workSpace);

            //var workSpace = new Form1();
            Application.Run(workSpace);
        }
    }
}
